﻿using System;
using OpusSuite.Globalisation.Resources;
using OpusSuite.Utility;

namespace OpusSuite.Globalisation
{
    public static class UIResources
    {
        public static string GetMessage(Enums.OpusSuiteResource resource, string resourceName, params Object[] args)
        {
            string s = null;

            switch (resource)
            {
                case Enums.OpusSuiteResource.Ref:
                    s = ModelRef.ResourceManager.GetString(resourceName);
                    break;

                case Enums.OpusSuiteResource.Common:
                    s = UICommon.ResourceManager.GetString(resourceName);
                    break;

                case Enums.OpusSuiteResource.Setup:
                    s = Setup.ResourceManager.GetString(resourceName);
                    break;

                case Enums.OpusSuiteResource.UserProfile:
                    s = UserProfile.ResourceManager.GetString(resourceName);
                    break;

                case Enums.OpusSuiteResource.AccountAdmin:
                    s = AccountAdmin.ResourceManager.GetString(resourceName);
                    break;


            }

            return string.Format(s ?? resourceName, args);
        }
    }
}
